package com.zhp.keyresolver.impl;

import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.zhp.anno.Idempotent;
import com.zhp.keyresolver.IdempotentKeyResolver;
import org.aspectj.lang.JoinPoint;

/**
 * @author zhanghp
 * @since 2024/5/27 10:11
 */
public class DefaultIdempotentKeyResolver implements IdempotentKeyResolver {
    @Override
    public String assembleKey(JoinPoint joinPoint, Idempotent idempotent) {
        return SecureUtil.md5(joinPoint.getSignature().toString() + StrUtil.join("-", joinPoint.getArgs()));
    }
}
